<template>
  <div class="home-swiper" v-if="imgLists.length>1" >
    <swiper :options="swiperOption"  >
      <swiper-slide   v-for="(item,index) in imgLists" :key="index" >
        <img :src="item.imgUrl" />
      </swiper-slide>
      <!-- 	<swiper-slide>
				<img src="http://img1.qunarzz.com/piao/fusion/1706/b9/6b91b49794f46402.jpg_750x200_d7f254e2.jpg" />
			</swiper-slide>
			<swiper-slide>
				<img src="http://img1.qunarzz.com/piao/fusion/1706/b9/6b91b49794f46402.jpg_750x200_d7f254e2.jpg" />
			</swiper-slide> -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
  export default {
    name: 'home-swiper',
    props: ["imgLists"],
    data() {
      return {
        swiperOption: {
          pagination: {
            el: ".swiper-pagination"
          },
          loop: true,
          autoplay: {
            disableOnInteraction: false, // 阻止点击事件冒泡
            delay: 500,
          }
        }
      }
    }
  }
</script>

<style>
  .home-swiper {
    width: 100%;
    height: 48.5%;
  }

  .home-swiper img {
    width: 100%;
    height: 100%;
  }

  .home-swiper .swiper-pagination-bullet-active {
    background: #FFFFFF;
  }
</style>
